package opengraph.api

interface HtmlFetcher {
    fun fetch(url: String): String
}

interface HtmlParser {
    fun parse(html: String): HtmlContext
}

interface NamespaceContext {
    companion object {
        val og:String ="https://ogp.me/ns#"
    }
    fun getNamespace(schema: String): List<String>?
    fun getSchema(ns: String): String?
    fun setNamespace(ns:String, schema: String)
}

data class HtmlMeta(var property: String, val value: String, val type:Int){
    companion object {
        const val TYPE_OG = 1
        const val TYPE_DEFAULT = 1
    }
}

data class HtmlContext(val htmlMetas :List<HtmlMeta>, val namespaceContext: NamespaceContext)